package com.agent.service.impl;

import com.agent.entity.RecordFile;
import com.agent.page.EasyuiPage;
import com.agent.dao.two.RecordFileMapper;
import com.agent.service.IRecordFileService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
@Service
public class RecordFileServiceImpl implements IRecordFileService {
    @Autowired
    RecordFileMapper recordFileMapper;
    @Override
    public EasyuiPage<RecordFile> list(Integer page, Integer rows, Map<String, String> map) throws Exception {
        PageHelper.startPage(page, rows,true, true, true);
        List<RecordFile> list = recordFileMapper.list(map);
        EasyuiPage<RecordFile> pages = new EasyuiPage<RecordFile>();
        pages.setRows(list);
        PageInfo<RecordFile> pageinfo = new PageInfo<RecordFile>(list);
        pages.setTotal(pageinfo.getTotal());
        return pages;
    }
}
